const { build } = require('vite-plugin-electron')

module.exports = {
  productName: 'signatureBoard',
  appId: 'Your APPID', // appId, 随便起的, 目前没影响
  copyright: 'Copyright © 2025',
  directories: {
    output: 'release/${version}', // 打包成功后的文件夹名称
    buildResources: 'build',
  },
  files: [
    'dist',
    'dist-electron',
    '!**/package-lock.json',
  ],
  asar: true,
  compression: 'maximum',
  win: {
    target: [
      {
        target: 'nsis',
        arch: ['x64']
      }
    ],
    icon: path.join(__dirname, 'public/icons/icon.ico'), // Windows 图标
    // 打包时会出现解压winCodeSign-2.6.0.7z的报错,
    // 一般是由于权限不足或者系统不支持符号链接导致的
    // 可以尝试禁用符号链接创建来解决问题
    // 禁用符号链接创建
    signAndEditExecutable: false,
  },
  mac: {
    target: 'dmg',
    icon: path.join(__dirname, 'public/icons/icon.icns'), // macOS 图标
    signAndEditExecutable: false,
  },
  linux: {
    target: 'AppImage',
    icon: path.join(__dirname, 'public/icons/icon.png'), // Linux 图标
    signAndEditExecutable: false,
  },
  nsis: {
    oneClick: false,
    allowElevation: true,
    allowToChangeInstallationDirectory: true,
    createDesktopShortcut: true,
    createStartMenuShortcut: true,
    shortcutName: 'signatureBoard',
    uninstallDisplayName: 'signatureBoard',
    runAfterFinish: false,
    // include: 'build/installer.nsh',
  },
}